package com.wrupple.vegetate.domain;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArrayMixed;
import com.google.gwt.core.client.JsArrayString;

public final class JsVegetateResultSet extends JavaScriptObject implements
		VegetateResultSet {

	protected JsVegetateResultSet() {
		super();
	}

	public String getIdAsString() {
		return getName();
	}

	public void setIdAsString(String id) {
		setName(id);
	}

	public native String getName()/*-{
		return this.name;
	}-*/;

	public native void setName(String name)/*-{
		this.name=name;
	}-*/;

	
	public native JsArrayString getColumnNames()/*-{
		var regreso = new Array();
		for ( var key in this.contents) {
			regreso.push(key);
		}
		return regreso;
	}-*/;

	public native JsArrayMixed getColumn(String fieldId) /*-{
		return this.contents[fieldId];
	}-*/;

	public native String getJoinableField() /*-{
		return this.joinableField;
	}-*/;

	public native  void setJoinableField(String foreignField)/*-{
	this.joinableField=foreignField;
}-*/;

}
